<?php
	include_once "../classes/giaovienvaitro_bs.php";
	include_once "../classes/hopdong_bs.php";
	include_once "../classes/lophoc_bs.php";
	
	if(isset($_GET['id']))
	{
		$ID = strtoupper(trim($_GET['id']));
		$Radio1  = '';
		$Radio2  = '';
		$HopDong = new hopdong_bs();
		$HopDong->SetMaLopHoc($ID);
		$HopDong->SetMaVaiTro('VG01');
		$DHopDong = $HopDong->LayDanhSach();
		$GiaoVienVaiTro = new giaovienvaitro_bs();
		$DGiaoVienVaiTro = $GiaoVienVaiTro->LayDanhSach();
		
		if($DHopDong == null)
		{
			$Radio1 .= '<input checked="true" name="VaiTro" type="radio" id="r1" class="css-radio" value="' . $DGiaoVienVaiTro[0]['MaVaiTro'] . '"/>
						<label for="r1" class="css-labelRadio"> ' . $DGiaoVienVaiTro[0]['TenVaiTro'] . ' </label>';
			$Radio2 .= '<input name="VaiTro" type="radio" id="r2" class="css-radio" value="' . $DGiaoVienVaiTro[1]['MaVaiTro'] . '"/>
						<label for="r2" class="css-labelRadio"> ' . $DGiaoVienVaiTro[1]['TenVaiTro'] . ' </label>';
		}
		else
		{
			$Radio1 .= '<input style="background-color:#f1f1f1" disabled="true" name="VaiTro" type="radio" id="r1" class="css-radio" value="' . $DGiaoVienVaiTro[0]['MaVaiTro'] . '"/>
						<label for="r1" class="css-labelRadio"> ' . $DGiaoVienVaiTro[0]['TenVaiTro'] . ' </label>';
			$Radio2 .= '<input checked="true" name="VaiTro" type="radio" id="r2" class="css-radio" value="' . $DGiaoVienVaiTro[1]['MaVaiTro'] . '"/>
						<label for="r2" class="css-labelRadio"> ' . $DGiaoVienVaiTro[1]['TenVaiTro'] . ' </label>';
		}
		
		echo $Radio1;
		echo $Radio2;
	}
?>